API: Remove gdk_drawable_set_colormap()
authorBenjamin Otte <otte@redhat.com>
Sat, 28 Aug 2010 22:03:01 +0000 (00:03 +0200)
committerBenjamin Otte <otte@redhat.com>
Sun, 26 Sep 2010 13:11:32 +0000 (15:11 +0200)
docs/reference/gdk/gdk3-sections.txt
gdk/gdk.symbols
gdk/gdkdraw.c
gdk/gdkdrawable.h
gdk/gdkoffscreenwindow.c
gdk/gdkwindow.c
gdk/quartz/gdkdrawable-quartz.c
gdk/win32/gdkdrawable-win32.c
gdk/win32/gdkwindow-win32.c
gdk/x11/gdkdrawable-x11.c
gdk/x11/gdkwindow-x11.c

index f00de0bab858ec858e7bf9e30da26afbc446e03e..29bc8c50cefceb47767fb4425d8d0f78b78ee46f 100644 (file)
@@ -288,7 +288,6 @@ GdkDrawable
 gdk_drawable_get_display
 gdk_drawable_get_screen
 gdk_drawable_get_visual
-gdk_drawable_set_colormap
 gdk_drawable_get_colormap
 gdk_drawable_get_depth
 gdk_drawable_get_size
index e4a625bbea712713fb0adc499dea7ac097e4d3f0..310865f91b65b183e168afd6c32de7a8b55a0ca7 100644 (file)
@@ -541,7 +541,6 @@ gdk_drawable_get_size
 gdk_drawable_get_type G_GNUC_CONST
 gdk_drawable_get_visible_region
 gdk_drawable_get_visual
-gdk_drawable_set_colormap
 #endif
 #endif
 
index 7ea8e6981826353cc4e1e9d54c50e6a1ab99a16b..c3e2d4c2a4b1b335dc21049fbeb5f3c725ce9a43 100644 (file)
@@ -150,29 +150,6 @@ gdk_drawable_get_display (GdkDrawable *drawable)
   return gdk_screen_get_display (gdk_drawable_get_screen (drawable));
 }
        
-/**
- * gdk_drawable_set_colormap:
- * @drawable: a #GdkDrawable
- * @colormap: a #GdkColormap
- *
- * Sets the colormap associated with @drawable. Normally this will
- * happen automatically when the drawable is created; you only need to
- * use this function if the drawable-creating function did not have a
- * way to determine the colormap, and you then use drawable operations
- * that require a colormap. The colormap for all drawables and
- * graphics contexts you intend to use together should match.
- **/
-void
-gdk_drawable_set_colormap (GdkDrawable *drawable,
-                           GdkColormap *cmap)
-{
-  g_return_if_fail (GDK_IS_DRAWABLE (drawable));
-  g_return_if_fail (cmap == NULL || gdk_drawable_get_depth (drawable)
-                    == cmap->visual->depth);
-
-  GDK_DRAWABLE_GET_CLASS (drawable)->set_colormap (drawable, cmap);
-}
-
 /**
  * gdk_drawable_get_colormap:
  * @drawable: a #GdkDrawable
index 7e02b299ea3e8aa9dbb2c20fa555006a2a21125a..db146c3c30ce52515083e3d70e12692a2f7b5068 100644 (file)
@@ -61,9 +61,6 @@ struct _GdkDrawableClass
                           gint         *width,
                           gint         *height);
 
-  void (*set_colormap)   (GdkDrawable  *drawable,
-                          GdkColormap  *cmap);
-
   GdkColormap* (*get_colormap) (GdkDrawable  *drawable);
   GdkVisual*   (*get_visual)   (GdkDrawable  *drawable);
   GdkScreen*   (*get_screen)   (GdkDrawable  *drawable);
@@ -98,8 +95,6 @@ GType           gdk_drawable_get_type     (void) G_GNUC_CONST;
 void            gdk_drawable_get_size     (GdkDrawable   *drawable,
                                           gint           *width,
                                           gint           *height);
-void           gdk_drawable_set_colormap (GdkDrawable    *drawable,
-                                          GdkColormap    *colormap);
 GdkColormap*    gdk_drawable_get_colormap (GdkDrawable   *drawable);
 GdkVisual*      gdk_drawable_get_visual   (GdkDrawable   *drawable);
 gint            gdk_drawable_get_depth    (GdkDrawable   *drawable);
index 7d25d5b54716d5465c11af17254ad539ee3b621b..e231f62a3f82a7dc91938a177e4c258737336b96 100644 (file)
@@ -148,27 +148,6 @@ gdk_offscreen_window_get_colormap (GdkDrawable *drawable)
   return offscreen->colormap;
 }
 
-static void
-gdk_offscreen_window_set_colormap (GdkDrawable *drawable,
-                                  GdkColormap*colormap)
-{
-  GdkOffscreenWindow *offscreen = GDK_OFFSCREEN_WINDOW (drawable);
-
-  if (colormap && GDK_WINDOW_DESTROYED (offscreen->wrapper))
-    return;
-
-  if (offscreen->colormap == colormap)
-    return;
-
-  if (offscreen->colormap)
-    g_object_unref (offscreen->colormap);
-
-  offscreen->colormap = colormap;
-  if (offscreen->colormap)
-    g_object_ref (offscreen->colormap);
-}
-
-
 static gint
 gdk_offscreen_window_get_depth (GdkDrawable *drawable)
 {
@@ -756,7 +735,6 @@ gdk_offscreen_window_class_init (GdkOffscreenWindowClass *klass)
   object_class->finalize = gdk_offscreen_window_finalize;
 
   drawable_class->ref_cairo_surface = gdk_offscreen_window_ref_cairo_surface;
-  drawable_class->set_colormap = gdk_offscreen_window_set_colormap;
   drawable_class->get_colormap = gdk_offscreen_window_get_colormap;
   drawable_class->get_depth = gdk_offscreen_window_get_depth;
   drawable_class->get_screen = gdk_offscreen_window_get_screen;
index 863c943df3c96381d039f0d4da03f25ae4cdf5b2..d77416a93a8d83cb34b25c1489d2148703702760 100644 (file)
@@ -230,8 +230,6 @@ static void   gdk_window_real_get_size  (GdkDrawable     *drawable,
 static GdkVisual*   gdk_window_real_get_visual   (GdkDrawable *drawable);
 static gint         gdk_window_real_get_depth    (GdkDrawable *drawable);
 static GdkScreen*   gdk_window_real_get_screen   (GdkDrawable *drawable);
-static void         gdk_window_real_set_colormap (GdkDrawable *drawable,
-                                                 GdkColormap *cmap);
 static GdkColormap* gdk_window_real_get_colormap (GdkDrawable *drawable);
 
 static cairo_region_t*   gdk_window_get_clip_region        (GdkDrawable *drawable);
@@ -381,7 +379,6 @@ gdk_window_class_init (GdkWindowObjectClass *klass)
   drawable_class->get_depth = gdk_window_real_get_depth;
   drawable_class->get_screen = gdk_window_real_get_screen;
   drawable_class->get_size = gdk_window_real_get_size;
-  drawable_class->set_colormap = gdk_window_real_set_colormap;
   drawable_class->get_colormap = gdk_window_real_get_colormap;
   drawable_class->get_visual = gdk_window_real_get_visual;
   drawable_class->ref_cairo_surface = gdk_window_ref_cairo_surface;
@@ -2059,8 +2056,6 @@ _gdk_window_destroy_hierarchy (GdkWindow *window,
 
          window_remove_filters (window);
 
-         gdk_drawable_set_colormap (GDK_DRAWABLE (window), NULL);
-
          window_remove_from_pointer_info (window, display);
 
          if (private->clip_region)
@@ -3644,27 +3639,6 @@ gdk_window_real_get_screen (GdkDrawable *drawable)
   return gdk_drawable_get_screen (GDK_WINDOW_OBJECT (drawable)->impl);
 }
 
-static void
-gdk_window_real_set_colormap (GdkDrawable *drawable,
-                             GdkColormap *cmap)
-{
-  GdkWindowObject *private;
-
-  g_return_if_fail (GDK_IS_WINDOW (drawable));
-
-  if (GDK_WINDOW_DESTROYED (drawable))
-    return;
-
-  private = (GdkWindowObject *)drawable;
-
-  /* different colormap than parent, requires native window */
-  if (!private->input_only &&
-      cmap != gdk_drawable_get_colormap ((GdkDrawable *)(private->parent)))
-    gdk_window_ensure_native ((GdkWindow *)drawable);
-
-  gdk_drawable_set_colormap (private->impl, cmap);
-}
-
 static GdkColormap*
 gdk_window_real_get_colormap (GdkDrawable *drawable)
 {
index 18220616f6b1bd6e4e895372c65567d2837ec6cd..1831aa640c850556a9e1e953c2cf03b8d651f17c 100644 (file)
@@ -106,22 +106,6 @@ gdk_quartz_ref_cairo_surface (GdkDrawable *drawable)
   return impl->cairo_surface;
 }
 
-static void
-gdk_quartz_set_colormap (GdkDrawable *drawable,
-                        GdkColormap *colormap)
-{
-  GdkDrawableImplQuartz *impl = GDK_DRAWABLE_IMPL_QUARTZ (drawable);
-
-  if (impl->colormap == colormap)
-    return;
-  
-  if (impl->colormap)
-    g_object_unref (impl->colormap);
-  impl->colormap = colormap;
-  if (impl->colormap)
-    g_object_ref (impl->colormap);
-}
-
 static GdkColormap*
 gdk_quartz_get_colormap (GdkDrawable *drawable)
 {
@@ -172,7 +156,6 @@ gdk_drawable_impl_quartz_class_init (GdkDrawableImplQuartzClass *klass)
   drawable_class->ref_cairo_surface = gdk_quartz_ref_cairo_surface;
   drawable_class->create_cairo_surface = gdk_quartz_create_cairo_surface;
 
-  drawable_class->set_colormap = gdk_quartz_set_colormap;
   drawable_class->get_colormap = gdk_quartz_get_colormap;
 
   drawable_class->get_depth = gdk_quartz_get_depth;
index e594b88f7b80c542f1400b1bde61754608636bcd..2ad840ecab19c1967443ee426e3aee07c4e3c754 100644 (file)
@@ -53,9 +53,6 @@ static cairo_surface_t *gdk_win32_create_cairo_surface (GdkDrawable *drawable,
                                                         int          width,
                                                         int          height);
      
-static void gdk_win32_set_colormap   (GdkDrawable    *drawable,
-                                     GdkColormap    *colormap);
-
 static GdkColormap* gdk_win32_get_colormap   (GdkDrawable    *drawable);
 
 static gint         gdk_win32_get_depth      (GdkDrawable    *drawable);
@@ -82,7 +79,6 @@ _gdk_drawable_impl_win32_class_init (GdkDrawableImplWin32Class *klass)
   drawable_class->ref_cairo_surface = gdk_win32_ref_cairo_surface;
   drawable_class->create_cairo_surface = gdk_win32_create_cairo_surface;
   
-  drawable_class->set_colormap = gdk_win32_set_colormap;
   drawable_class->get_colormap = gdk_win32_get_colormap;
 
   drawable_class->get_depth = gdk_win32_get_depth;
@@ -98,8 +94,6 @@ _gdk_drawable_impl_win32_init (GdkDrawableImplWin32 *impl)
 static void
 gdk_drawable_impl_win32_finalize (GObject *object)
 {
-  gdk_drawable_set_colormap (GDK_DRAWABLE (object), NULL);
-
   G_OBJECT_CLASS (_gdk_drawable_impl_win32_parent_class)->finalize (object);
 }
 
@@ -113,22 +107,6 @@ gdk_win32_get_colormap (GdkDrawable *drawable)
   return GDK_DRAWABLE_IMPL_WIN32 (drawable)->colormap;
 }
 
-static void
-gdk_win32_set_colormap (GdkDrawable *drawable,
-                       GdkColormap *colormap)
-{
-  GdkDrawableImplWin32 *impl = GDK_DRAWABLE_IMPL_WIN32 (drawable);
-
-  if (impl->colormap == colormap)
-    return;
-  
-  if (impl->colormap)
-    g_object_unref (impl->colormap);
-  impl->colormap = colormap;
-  if (impl->colormap)
-    g_object_ref (impl->colormap);
-}
-
 /* Drawing
  */
 
index b98cdbd3fcdbb4fadfc46f5d988b3aa0c91fcb73..0ec688b25b98927cdcde99b1ab712293809f8e52 100644 (file)
@@ -38,8 +38,6 @@
 #include "gdkenumtypes.h"
 
 static GdkColormap* gdk_window_impl_win32_get_colormap (GdkDrawable *drawable);
-static void         gdk_window_impl_win32_set_colormap (GdkDrawable *drawable,
-                                                       GdkColormap *cmap);
 static void gdk_window_impl_win32_init       (GdkWindowImplWin32      *window);
 static void gdk_window_impl_win32_class_init (GdkWindowImplWin32Class *klass);
 static void gdk_window_impl_win32_finalize   (GObject                 *object);
@@ -134,7 +132,6 @@ gdk_window_impl_win32_class_init (GdkWindowImplWin32Class *klass)
 
   object_class->finalize = gdk_window_impl_win32_finalize;
 
-  drawable_class->set_colormap = gdk_window_impl_win32_set_colormap;
   drawable_class->get_colormap = gdk_window_impl_win32_get_colormap;
 }
 
@@ -211,28 +208,6 @@ gdk_window_impl_win32_get_colormap (GdkDrawable *drawable)
   return drawable_impl->colormap;
 }
 
-static void
-gdk_window_impl_win32_set_colormap (GdkDrawable *drawable,
-                                   GdkColormap *cmap)
-{
-  GdkWindowImplWin32 *impl;
-  GdkDrawableImplWin32 *draw_impl;
-  
-  g_return_if_fail (GDK_IS_WINDOW_IMPL_WIN32 (drawable));
-
-  impl = GDK_WINDOW_IMPL_WIN32 (drawable);
-  draw_impl = GDK_DRAWABLE_IMPL_WIN32 (drawable);
-
-  /* chain up */
-  GDK_DRAWABLE_CLASS (parent_class)->set_colormap (drawable, cmap);
-  
-  if (cmap)
-    {
-      /* XXX */
-      g_print ("gdk_window_impl_win32_set_colormap: XXX\n");
-    }
-}
-
 void
 _gdk_root_window_size_init (void)
 {
index a715bd1246090a09c6cb662a7500298da3c38401..2011a1c7e0ea83d5e1a8f297b6f21bfc202ce6d6 100644 (file)
@@ -44,16 +44,11 @@ static cairo_surface_t *gdk_x11_create_cairo_surface (GdkDrawable *drawable,
                                                       int          width,
                                                       int          height);
      
-static void gdk_x11_set_colormap   (GdkDrawable    *drawable,
-                                    GdkColormap    *colormap);
-
 static GdkColormap* gdk_x11_get_colormap   (GdkDrawable    *drawable);
 static gint         gdk_x11_get_depth      (GdkDrawable    *drawable);
 static GdkScreen *  gdk_x11_get_screen    (GdkDrawable    *drawable);
 static GdkVisual*   gdk_x11_get_visual     (GdkDrawable    *drawable);
 
-static void gdk_drawable_impl_x11_finalize   (GObject *object);
-
 static const cairo_user_data_key_t gdk_x11_cairo_key;
 
 G_DEFINE_TYPE (GdkDrawableImplX11, _gdk_drawable_impl_x11, GDK_TYPE_DRAWABLE)
@@ -62,14 +57,10 @@ static void
 _gdk_drawable_impl_x11_class_init (GdkDrawableImplX11Class *klass)
 {
   GdkDrawableClass *drawable_class = GDK_DRAWABLE_CLASS (klass);
-  GObjectClass *object_class = G_OBJECT_CLASS (klass);
-  
-  object_class->finalize = gdk_drawable_impl_x11_finalize;
   
   drawable_class->ref_cairo_surface = gdk_x11_ref_cairo_surface;
   drawable_class->create_cairo_surface = gdk_x11_create_cairo_surface;
 
-  drawable_class->set_colormap = gdk_x11_set_colormap;
   drawable_class->get_colormap = gdk_x11_get_colormap;
 
   drawable_class->get_depth = gdk_x11_get_depth;
@@ -82,14 +73,6 @@ _gdk_drawable_impl_x11_init (GdkDrawableImplX11 *impl)
 {
 }
 
-static void
-gdk_drawable_impl_x11_finalize (GObject *object)
-{
-  gdk_drawable_set_colormap (GDK_DRAWABLE (object), NULL);
-
-  G_OBJECT_CLASS (_gdk_drawable_impl_x11_parent_class)->finalize (object);
-}
-
 /**
  * _gdk_x11_drawable_finish:
  * @drawable: a #GdkDrawableImplX11.
@@ -144,24 +127,6 @@ gdk_x11_get_colormap (GdkDrawable *drawable)
   return impl->colormap;
 }
 
-static void
-gdk_x11_set_colormap (GdkDrawable *drawable,
-                      GdkColormap *colormap)
-{
-  GdkDrawableImplX11 *impl;
-
-  impl = GDK_DRAWABLE_IMPL_X11 (drawable);
-
-  if (impl->colormap == colormap)
-    return;
-  
-  if (impl->colormap)
-    g_object_unref (impl->colormap);
-  impl->colormap = colormap;
-  if (impl->colormap)
-    g_object_ref (impl->colormap);
-}
-
 static gint
 gdk_x11_get_depth (GdkDrawable *drawable)
 {
index deaf4498c0ea97cafaf2667329eca2d63e41d67a..d62e343e7451ffa98142535da061252a35008a15 100644 (file)
@@ -112,8 +112,6 @@ static void     gdk_window_x11_set_background     (GdkWindow      *window,
                                                    cairo_pattern_t *pattern);
 
 static GdkColormap* gdk_window_impl_x11_get_colormap (GdkDrawable *drawable);
-static void         gdk_window_impl_x11_set_colormap (GdkDrawable *drawable,
-                                                     GdkColormap *cmap);
 static void        gdk_window_impl_x11_finalize   (GObject            *object);
 static void        gdk_window_impl_iface_init     (GdkWindowImplIface *iface);
 
@@ -182,7 +180,6 @@ gdk_window_impl_x11_class_init (GdkWindowImplX11Class *klass)
   
   object_class->finalize = gdk_window_impl_x11_finalize;
 
-  drawable_class->set_colormap = gdk_window_impl_x11_set_colormap;
   drawable_class->get_colormap = gdk_window_impl_x11_get_colormap;
 }
 
@@ -454,35 +451,6 @@ gdk_window_impl_x11_get_colormap (GdkDrawable *drawable)
   return drawable_impl->colormap;
 }
 
-static void
-gdk_window_impl_x11_set_colormap (GdkDrawable *drawable,
-                                  GdkColormap *cmap)
-{
-  GdkDrawableImplX11 *draw_impl;
-  
-  g_return_if_fail (GDK_IS_WINDOW_IMPL_X11 (drawable));
-
-  draw_impl = GDK_DRAWABLE_IMPL_X11 (drawable);
-
-  if (cmap && GDK_WINDOW_DESTROYED (draw_impl->wrapper))
-    return;
-
-  /* chain up */
-  GDK_DRAWABLE_CLASS (gdk_window_impl_x11_parent_class)->set_colormap (drawable, cmap);
-
-  if (cmap)
-    {
-      XSetWindowColormap (GDK_SCREEN_XDISPLAY (draw_impl->screen),
-                          draw_impl->xid,
-                          GDK_COLORMAP_XCOLORMAP (cmap));
-
-      if (((GdkWindowObject*)draw_impl->wrapper)->window_type !=
-          GDK_WINDOW_TOPLEVEL)
-        gdk_window_add_colormap_windows (GDK_WINDOW (draw_impl->wrapper));
-    }
-}
-
-
 void
 _gdk_windowing_window_init (GdkScreen * screen)
 {